{% extends "base.html" %}
{% load static %}
{% block module %}
<link href="{% static 'css/tms_flow.css' %}" rel="stylesheet">
<link href="{% static 'css/masking.css' %}" rel="stylesheet">
<script src="{% static 'js/tms_flow.js' %}"></script>
<script src="{% static 'js/masking.js' %}"></script>
<script src="{% static 'js/pop_up.js' %}"></script>
{% endblock %}
{% block body %}
<div class="container">
    <div class="local box_title">
        <h3>环境切换</h3>
        <div class="env_select dev_env">
            <button type="button" tp="dev" class="dev_env">测试环境</button><span class="env">域名：<span
                    class="content">未应用</span></span>
        </div>
        <div class="env_select yf_env">
            <button type="button" tp="yf" class="yf_env">预发环境</button><span class="env">域名：<span
                    class="content">未应用</span></span>
        </div>
    </div>
    <div class="sql box_title">
        <h3>SQL连接</h3>
        <div class="sql_select connect_sql_env">
            <button type="button" tp="connect_sql" class="connect_sql_env">连接SQL</button><span class="env">数据库：<span
                    class="content">未连接</span></span>
        </div>
    </div>

    <div class="login box_title">
        <h3>TMS 登录操作</h3>
        <form action="{% url 'tms_flow:tms_flow' %}" method="post" class="pc_login">
            {% csrf_token %}
            <input type="text" id="pcname" placeholder="PC端用户名" value="admin" name="pcname">
            <input type="text" id="pcpd" placeholder="PC端用户名" value="1q2w3E*" name="pcpd"><br>
            <button type="submit">PC端登录</button><span id="pc_login">未登录</span>
        </form>
        <br>
        <form action="{% url 'tms_flow:tms_flow' %}" method="post" class="app_login">
            {% csrf_token %}
            <input type="text" id="appname" placeholder="APP端用户名" value="gcw001" name="appname">
            <input type="text" id="apppd" placeholder="APP端用户名" value="Aa123." name="apppd"><br>
            <button type="submit">APP端登录</button><span id="app_login">未登录</span>
        </form>
        <br>

    </div>
    <div class="prepose_data box_title">
        <h3>前置数据</h3>
        <div class="env_select get_info">
            <button type="button" tp="get_store_info" class="get_store_info">获取仓库信息</button>
            <span class="env">获取：<span class="content">未获取</span></span><br>
            <button type="button" tp="get_dispatching_rule" class="get_dispatching_rule">获取配送规则</button><span
                class="env">获取：<span class="content">未获取</span></span><br>
            <button type="button" tp="get_treaty_config" class="get_treaty_config">获取合约规则</button><span
                class="env">获取：<span class="content">未获取</span></span><br>
            <button type="button" tp="get_cargo" class="get_cargo">获取物料</button><span class="env">获取：<span
                    class="content">未获取</span></span>
        </div>
    </div>
    <div class="sales_order box_title">
        <h3>销售订单操作</h3>
        <form action="{% url 'tms_flow:tms_flow' %}" method="post" class="sales_order_query">
            <input type="text" id="sales_order_no" placeholder="销售订单号" name="sales_order_no">&nbsp;&nbsp;&nbsp;&nbsp;
            <button type="submit">查询</button><br>
            <span class="status">状态：<span class="sales_status_content"></span> </span>
        </form><br>
        <div class="order_operation_list">
            <div class="sales_try box_title sales_operation">
                <h3>订单异常</h3><br>
                <button type="button" tp="set_cargo" class="set_cargo_masking">设置物料</button>
                <button type="button" tp="set_one_hy_rule" class="set_one_hy_rule">启用一级合约</button>
                <button type="button" tp="set_two_hy_rule" class="set_two_hy_rule">启用二级合约</button>
                <button type="button" tp="set_hy_address" class="set_hy_address">设置合约地址</button>
                <button type="button" tp="set_ps_rule" class="set_ps_rule">设置配送地址</button>
                <button type="button" tp="sales_reset" class="sales_reset">重新判断</button>
            </div>
            <div class="delivery_appointment box_title sales_operation ">
                <h3>配送预约</h3><br>
                <label>司机手机号：</label>
                <span class="driver_phone"></span>
                <button type="button" tp="get_driver_iphone">获取</button><br>
                <button type="button" tp="driver_bespeak">预约</button>
                <button type="button" tp="baspeak_audit">审核成功</button>
                <button type="button" tp="driver_sign">签到</button>
                <button type="button" tp="sales_order_allot">订单分配</button><br>
            </div>
            <div class="presell box_title sales_operation">
                <h3>预售操作</h3><br>
                <button type="button" tp="presell_plan_distribution">预售计划分配</button>
                <button type="button" tp="presell_plan_retrieve">预售计划回收</button>
                <button type="button" tp="presell_plan_force_distribution">预售计划强制分配</button>
                <button type="button" tp="presell_plan_force_retrieve">预售计划强制回收</button>
            </div>
            <div class="untread box_title sales_operation">
                <h3>退回操作</h3><br>
                <button type="button" tp="untread_order_audit">退回订单审核</button>
                <button type="button" tp="get_untread_transport_order">获取退回运单</button>
            </div>
        </div>
    </div>
    <div class="logistics_order box_title">
        <h3>物流订单操作</h3>
        <form action="{% url 'tms_flow:tms_flow' %}" method="post" class="logistics_order_query">
            <input type="text" id="logistics_order_no" placeholder="装车单号"
                name="logistics_order_no">&nbsp;&nbsp;&nbsp;&nbsp;
            <button type="submit">查询</button><br>
            <span class="status">状态：<span class="logistics_status_content"></span> </span>
        </form><br>
        <div class="order_operation_list">
            <div class="box_title logistics_operation">
                <h3>装车单创建</h3><br>
                <button type="button" tp="get_logistics_order" class="get_logistics_order_masking">创建装车单</button>
                <button type="button" tp="get_logistics_transport_order"
                    class="get_logistics_transport_order_masking">获取装车单</button>
            </div>
        </div>
    </div>
    <div class="transport_order box_title">
        <h3>装车单操作</h3>
        <form action="{% url 'tms_flow:tms_flow' %}" method="post" class="transport_order_query">
            <input type="text" id="transport_order_no" placeholder="装车单号"
                name="transport_order_no">&nbsp;&nbsp;&nbsp;&nbsp;
            <button type="submit">查询</button><br>
            <span class="status">状态：<span class="transport_status_content"></span> </span>
        </form><br>
        <div class="order_operation_list">
            <div class="box_title transport_operation">
                <h3>发货流程</h3><br>
                <button type="button" tp="allot">配货</button>
                <button type="button" tp="challenge">叫号</button><br>
                <button type="button" tp="into_factory">入厂</button>
                <button type="button" tp="first_loadometer">首磅</button>
                <button type="button" tp="loading">装货</button>
                <button type="button" tp="inspect">检查</button>
                <button type="button" tp="two_loadometer">二磅</button>
                <button type="button" tp="two_loadomter_hand_movement">二磅手动抬杆</button>
                <button type="button" tp="out_of_factory">出厂</button><br>
                <button type="button" tp="transport_order_arrival">到货</button>
                <button type="button" tp="transport_order_signfor">签收</button><br>
            </div>
            <div class="box_title transport_operation">
                <h3>退货流程</h3><br>
                <button type="button" tp="return_app_sign">司机签到</button>
                <button type="button" tp="challenge">叫号</button><br>
                <button type="button" tp="return_into_factory">退回入厂</button>
                <button type="button" tp="return_first_loadometer">退回首磅</button>
                <button type="button" tp="return_loading">退回卸货</button>
                <button type="button" tp="return_inspect">退回检查</button>
                <button type="button" tp="return_two_loadometer">退回二磅</button>
                <button type="button" tp="return_out_of_factory_audit">退回出厂审核</button>
                <button type="button" tp="return_out_ofFactory">退回出厂</button><br>
            </div>
            <div class="box_title transport_operation">
                <h3>冻结流程</h3><br>
                <button type="button" tp="freeze">冻结</button>
                <button type="button" tp="freeze_audio">冻结审核</button>
                <button type="button" tp="freeze_affirm">确认冻结</button>
                <button type="button" tp="freeze_stowage_cancel">取消装货</button>
                <button type="button" tp="freeze_loadometer">冻结二磅</button><br>
            </div>
        </div>
    </div>
</div>
<div class="modal-overlay">
    <div class="modal">
        {% csrf_token %}
        <div class="modal-content">
            {% include "tms_flow/set_cargo_modal_masking.html" %}
            {% include "tms_flow/create_transport_masking.html" %}
            {% include "tms_flow/get_logistics_order_masking.html" %}
        </div>
        <hr>
        <div class="modal-footer">
            <button class="btn btn-set-cargo-close">取消</button>
            <button class="btn btn-set-cargo-sure" tp="set_cargo">确定</button>
        </div>
    </div>
</div>
{% endblock %}